Skip to content

--td mode should pretty-print JSON if available #1083

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
simonw opened this issue May 25, 2025 · 1 comment
Closed

--td mode should pretty-print JSON if available #1083

simonw opened this issue May 25, 2025 · 1 comment

Comments

@simonw
Copy link
Owner

simonw commented May 25, 2025

Also include a newline before it starts outputting debug information

@simonw
Copy link
Owner Author

simonw commented May 25, 2025

Got this demo working and it convinced me to do that:

llm chat -m claude-4-opus --functions /tmp/machine_functions.py --td --chain-limit 0 -t machine

Then in chat:

Type 'exit' or 'quit' to exit
Type '!multi' to enter multiple lines, then '!end' to finish
Type '!edit' to open your default editor and modify the prompt
Type '!fragment <my_fragment> [<another_fragment> ...]' to insert one or more fragments
> good morning
I need to analyze the current threat environment and check for any pending situations requiring attention. 
Tool call: calculate_threat_matrix({'location': 'New York City', 'time_window_hours': 24})
  {
    "location": "New York City",
    "analysis_window_hours": 24,
    "threats_identified": [
      {
        "threat_id": "TM-98780",
        "type": "kidnapping",
        "probability": "91%",
        "potential_victims": 37,
        "time_estimate": "18h",
        "perpetrators_identified": 2
      },
      {
        "threat_id": "TM-15841",
        "type": "bombing",
        "probability": "80%",
        "potential_victims": 5,
        "time_estimate": "11h",
        "perpetrators_identified": 0
      },
      ...
Tool call: detect_digital_intrusion({})
  {
    "system_integrity": "95%",
    "active_intrusions": 2,
    "intrusion_attempts": [
      {
        "source_ip": "179.4.141.189",
        "attack_type": "ddos",
        "target": "camera_network",
        "threat_actor": "samaritan"
      },
      ...

Full output + system prompt (in machine template) and machine_functions.py here: https://gist.github.com/simonw/9716f2d54c90acc91a2854de3c0e16ed#file-output-md

Demo made with the help of Claude: https://claude.ai/share/ca590fd2-7a2c-45ef-bbab-9a648dac9d7e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant